package com.sprite.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * @author Jack
 * @see com.sprite.utils.security.UtilMessageDigest
 * @deprecated
 */
public final class UtilMD5 {

    public static String digest(String source, String salt) throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance("MD5");
        if (UtilString.isNotBlank(salt)) {
            source = source + "-/+" + salt;
        }
        md.update(source.getBytes());
        return new BigInteger(1, md.digest()).toString(16);
    }
}
